package com.xiaoyang.userservice.feign;

import com.xiaoyang.userservice.domain.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

/**
 * @auther XiaoYang
 * @DATE 2023/5/4-17:43
 */
@FeignClient(value = "order-service") //提供者的名称
public interface UserOrderFeign {

    @GetMapping("/doOrder")
    public String doOrder();

    @GetMapping("/testUrl/{name}/and/{age}")
    public String testUrl(@PathVariable String name,
                          @PathVariable Integer age);

    @GetMapping("/oneParam")
    public String oneParam(@RequestParam(required = false) String name);

    @GetMapping("/twoParam")
    public String twoParam(@RequestParam(required = false) String name,
                           @RequestParam(required = false) Integer age);

    @PostMapping("/oneObj")
    public String oneObj(@RequestBody Order order);

    @PostMapping("/oneObjOneParam")
    public String oneObjOneParam(@RequestBody Order order,
                                 @RequestParam("name") String name);

    @GetMapping("/testTime")
    public String testTime(@RequestParam Date date);

}
